<?php
$pid = $_POST["id"];
$name = $_POST["name"];
$title = $_POST["title"];
$type = $_POST["type"];
$price = $_POST["price"];

//造连接对象
$db = new MySQLi("localhost","root","root","pro");

$sql = "update product set named='{$name}',price={$price},title='{$title}',type='{$type}' where id='{$pid}'";

$db->query($sql);

header("location:o.php");